import string

def show_stats(type="match"):

    stat_file = open("yeni","r")

    start = False

    avg = 0
    
    distance_array = []

    for test_line in stat_file:
        #print test_line
        
        test_line=test_line.strip()
        if test_line.startswith(type):
            start = True

        elif test_line == "".join(["end",type]):
            start = False


        #demekki icindeyiz isle bakalim
        if start:
            x_split = test_line.split(":")

            #tamamen bu dosyaya ozgu baska yerde kullanilamaz
            if len(x_split)==2 and len(x_split[0])>10:
                print x_split[1]
                distance_array.append(float(x_split[1].strip()))


    #print distance_array
    min_one = min(distance_array)
    max_one = max(distance_array)
    avg_one = sum(distance_array)/len(distance_array)

    print "The min value for matching is : ",min_one
    print "The max value for matching is : ",max_one
    print "The avarage is : ",sum(distance_array)/len(distance_array)
    print "The trashold should be maximum :",(avg_one+min_one)/2

if __name__=="__main__":
    show_stats("dismatch")
